#include "manage.h"

http_manage *http_manage::get()
{
    static http_manage s_http_manage;
    return &s_http_manage;
}

http_manage::http_manage()
{
    m_map_http_conn.clear();
}

void http_manage::create_connection(int client_id)
{
    http_connection *p = new http_connection(client_id);
    m_map_http_conn[client_id] = p;
}

void http_manage::remove_connection(int client_id)
{
    http_connection *p = m_map_http_conn[client_id];
    m_map_http_conn.erase(client_id);
    delete p;
    p = NULL;
}

http_connection *http_manage::get_connection(int client_id)
{
    return m_map_http_conn[client_id];
}